<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="相机百科 - 全面的摄影器材信息平台">
    <meta name="keywords" content="相机,摄影,器材,配件,百科">
    <title>{% block title %}相机百科{% endblock %}</title>
    <!-- 更新到最新的Bootstrap 5.3 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- 添加Font Awesome图标 -->
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    
    <style>
        :root {
            --primary-color: #165DFF;
            --secondary-color: #36CFC9;
            --accent-color: #722ED1;
            --text-color: #262626;
            --text-secondary: #8C8C8C;
            --light-bg: #F5F7FA;
            --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            --transition: all 0.3s ease;
        }
        
        body {
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background-color: var(--light-bg);
            color: var(--text-color);
            line-height: 1.6;
        }
        
        .navbar {
            background-color: white;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            position: sticky;
            top: 0;
            z-index: 1000;
            transition: var(--transition);
        }
        
        .navbar.scrolled {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        
        .navbar-brand {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary-color);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .navbar-brand i {
            font-size: 1.8rem;
        }
        
        .nav-link {
            color: var(--text-color);
            font-weight: 500;
            position: relative;
            padding: 8px 16px !important;
            margin: 0 4px;
            transition: var(--transition);
        }
        
        .nav-link:hover,
        .nav-link.active {
            color: var(--primary-color);
        }
        
        .nav-link.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 16px;
            right: 16px;
            height: 2px;
            background-color: var(--primary-color);
            border-radius: 2px;
        }
        
        .container {
            max-width: 1200px;
            margin-top: 2rem;
        }
        
        .page-header {
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 2px solid #f0f0f0;
        }
        
        .page-header h1 {
            font-size: 2rem;
            font-weight: 700;
            color: var(--text-color);
            margin-bottom: 0.5rem;
        }
        
        .card {
            margin-bottom: 2rem;
            border: none;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: var(--card-shadow);
            transition: var(--transition);
        }
        
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        }
        
        .card-header {
            background-color: white;
            font-weight: 600;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .card-body {
            padding: 1.5rem;
        }
        
        .btn-primary {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
            font-weight: 500;
            padding: 8px 20px;
            border-radius: 6px;
            transition: var(--transition);
        }
        
        .btn-primary:hover {
            background-color: #0E42D2;
            border-color: #0E42D2;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
        }
        
        .btn-outline-primary {
            border-color: var(--primary-color);
            color: var(--primary-color);
            font-weight: 500;
            transition: var(--transition);
        }
        
        .btn-outline-primary:hover {
            background-color: var(--primary-color);
            color: white;
            transform: translateY(-1px);
        }
        
        .footer {
            margin-top: 4rem;
            padding: 2rem 0;
            background-color: #1D2129;
            color: #FFFFFF;
        }
        
        .footer h5 {
            font-weight: 600;
            margin-bottom: 1rem;
            font-size: 1.1rem;
        }
        
        .footer a {
            color: rgba(255, 255, 255, 0.7);
            text-decoration: none;
            transition: var(--transition);
        }
        
        .footer a:hover {
            color: white;
            text-decoration: none;
        }
        
        .social-icons {
            display: flex;
            gap: 12px;
        }
        
        .social-icons a {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }
        
        .social-icons a:hover {
            background-color: var(--primary-color);
            transform: translateY(-2px);
        }
        
        .copyright {
            margin-top: 2rem;
            padding-top: 1rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            font-size: 0.9rem;
            color: rgba(255, 255, 255, 0.5);
        }
        
        /* 搜索框样式 */
        .search-form {
            position: relative;
            max-width: 300px;
        }
        
        .search-form input {
            padding-left: 36px;
            border-radius: 20px;
            border: 1px solid #E5E6EB;
            transition: var(--transition);
        }
        
        .search-form input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
        }
        
        .search-form i {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
        }
        
        /* 响应式设计优化 */
        @media (max-width: 768px) {
            .container {
                margin-top: 1rem;
            }
            
            .page-header h1 {
                font-size: 1.6rem;
            }
            
            .navbar-brand {
                font-size: 1.3rem;
            }
            
            .search-form {
                max-width: 100%;
                margin-top: 10px;
            }
        }
        
        /* 加载动画 */
        .loader {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid #f3f3f3;
            border-radius: 50%;
            border-top: 3px solid var(--primary-color);
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        /* 滚动条美化 */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        
        ::-webkit-scrollbar-track {
            background: #f1f1f1;
        }
        
        ::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 4px;
        }
        
        ::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg">
        <div class="container">
            <a class="navbar-brand" href="{% url 'encyclopedia:camera_list' %}">
                <i class="fa fa-camera-retro"></i>
                相机百科
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link {% if request.resolver_match.url_name == 'camera_list' %}active{% endif %}" 
                           href="{% url 'encyclopedia:camera_list' %}">
                            <i class="fa fa-camera"></i> 相机列表
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.resolver_match.url_name == 'category_list' or request.resolver_match.url_name == 'category_detail' %}active{% endif %}" 
                           href="{% url 'encyclopedia:category_list' %}">
                            <i class="fa fa-th-large"></i> 分类浏览
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.resolver_match.url_name == 'accessory_list' %}active{% endif %}" 
                           href="{% url 'encyclopedia:accessory_list' %}">
                            <i class="fa fa-puzzle-piece"></i> 配件列表
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.resolver_match.url_name == 'accessory_category_list' or request.resolver_match.url_name == 'accessory_category_detail' %}active{% endif %}" 
                           href="{% url 'encyclopedia:accessory_category_list' %}">
                            <i class="fa fa-th"></i> 配件分类
                        </a>
                    </li>
                </ul>
                
                <!-- 搜索框 -->
                <form class="search-form d-flex" method="GET" action="{% url 'encyclopedia:camera_list' %}">
                    <i class="fa fa-search"></i>
                    <input class="form-control" type="search" placeholder="搜索相机或配件..." aria-label="Search" name="q">
                </form>
                
                <!-- 添加按钮 -->
                <div class="ms-lg-3 mt-2 mt-lg-0">
                    <a href="{% url 'encyclopedia:camera_add' %}" class="btn btn-primary btn-sm">
                        <i class="fa fa-plus"></i> 添加内容
                    </a>
                </div>
            </div>
        </div>
    </nav>

    <!-- 主要内容 -->
    <div class="container">
        {% block content %}
        {% endblock %}
    </div>

    <!-- 页脚 -->
    <footer class="footer">
        <div class="container">
            <div class="row">
                <div class="col-md-4">
                    <h5><i class="fa fa-camera-retro"></i> 相机百科</h5>
                    <p class="text-sm text-opacity-75">
                        全面的摄影器材信息平台，为摄影爱好者提供专业的相机和配件参考资料。
                    </p>
                    <div class="social-icons mt-3">
                        <a href="#" title="微博"><i class="fa fa-weibo"></i></a>
                        <a href="#" title="微信"><i class="fa fa-weixin"></i></a>
                        <a href="#" title="GitHub"><i class="fa fa-github"></i></a>
                        <a href="#" title="Gitee"><i class="fa fa-code-fork"></i></a>
                    </div>
                </div>
                
                <div class="col-md-4">
                    <h5><i class="fa fa-navicon"></i> 快速导航</h5>
                    <ul class="list-unstyled">
                        <li><a href="{% url 'encyclopedia:camera_list' %}"><i class="fa fa-angle-right"></i> 相机列表</a></li>
                        <li><a href="{% url 'encyclopedia:category_list' %}"><i class="fa fa-angle-right"></i> 分类浏览</a></li>
                        <li><a href="{% url 'encyclopedia:accessory_list' %}"><i class="fa fa-angle-right"></i> 配件列表</a></li>
                        <li><a href="{% url 'encyclopedia:about' %}"><i class="fa fa-angle-right"></i> 关于我们</a></li>
                    </ul>
                </div>
                
                <div class="col-md-4">
                    <h5><i class="fa fa-info-circle"></i> 关于项目</h5>
                    <p class="text-sm text-opacity-75">
                        相机百科是一个开源项目，旨在为摄影爱好者提供全面、准确的相机及配件信息。
                    </p>
                    <p class="text-sm text-opacity-75 mt-2">
                        <i class="fa fa-code"></i> 技术栈：Django + Bootstrap 5 + SQLite
                    </p>
                </div>
            </div>
            
            <div class="copyright text-center">
                <p>&copy; 2025 相机百科. All rights reserved.</p>
            </div>
        </div>
    </footer>

    <!-- 更新到最新的Bootstrap JS -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 导航栏滚动效果
        window.addEventListener('scroll', function() {
            const navbar = document.querySelector('.navbar');
            if (window.scrollY > 10) {
                navbar.classList.add('scrolled');
            } else {
                navbar.classList.remove('scrolled');
            }
        });
        
        // 平滑滚动
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
        
        // 添加页面加载动画
        document.addEventListener('DOMContentLoaded', function() {
            // 可以在这里添加页面加载完成后的动画效果
            console.log('相机百科页面加载完成');
        });
    </script>
</body>
</html>